package com.yupi.yuoj.model.dto.user;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 用户批量创建返回值
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://yupi.icu">编程导航知识星球</a>
 */
@Data
public class BatchRegisterResult implements Serializable{
    private int totalCount;
    private int successCount;
    private List<BatchRegisterError> failedRecords;

    public BatchRegisterResult() {
        this.failedRecords = new ArrayList<>();
    }

    public void incrementSuccessCount() {
        successCount++;
    }

    public void addFailedRecord(int rowNum, String message) {
        failedRecords.add(new BatchRegisterError(rowNum, message));
    }


}